<h1>Listing emails</h1>

<table>
  <tr>
    <th>Sender</th>
    <th>Receiver</th>
    <th>Content</th>
    <th>Time email</th>
    <th>Type</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @emails.each do |email| %>
  <tr>
    <td><%= email.sender_id %></td>
    <td><%= email.receiver_id %></td>
    <td><%= email.content %></td>
    <td><%= email.time_email %></td>
    <td><%= email.type %></td>
    <td><%= link_to 'Show', email %></td>
    <td><%= link_to 'Edit', edit_email_path(email) %></td>
    <td><%= link_to 'Destroy', email, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Email', new_email_path %>
